<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>less介绍</title>
    <style type="text/less">
        //定义变量
        @width:100px;
        @height:100px;
        @color:red;
        #box{
            position: absolute;
            left: 50%;
            top: 50%;
            width: @width;
            height: @height;
            margin-left: -@width/2;
            margin-top: -@height/2;
            border: 2px solid @color;
        }
    </style>
    <script src="less.js"></script>
</head>
<body>
    <div id="box"></div>
</body>
</html>